<template>
<div>
    <div class="menuleft">
        <el-menu default-active="1" class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose">
            <el-menu-item index="1">
                <router-link to="/Home">
                    <i class="icon iconfont icon-ziyuan"></i>返回首页
                </router-link>
            </el-menu-item>
            <el-menu-item index="2"  v-if="permissions.indexOf('预算调整')>-1">
                <router-link to="/budgetAdjust">
                    <i class="icon iconfont icon-yusuan"></i>&nbsp;预算调整单
                </router-link>
            </el-menu-item>
            <el-submenu index="3" v-if="permissions.indexOf('年度预算')>-1">
                <template slot="title">
                    <router-link to="/year"><i class="icon iconfont icon-yusuan"></i>&nbsp;年度预算</router-link>
                </template>
                <el-menu-item index="3-1" v-if="permissions.indexOf('预算主档')>-1">
                    <router-link to="/budgetMaster">
                        预算主档
                    </router-link>
                </el-menu-item>
            </el-submenu>
            <el-submenu index="4" v-if="permissions.indexOf('报表')>-1">
                <template slot="title"><i class="icon iconfont icon-yusuan"></i>&nbsp;报表</template>
                <el-menu-item index="4-1" v-if="permissions.indexOf('利润预算')>-1">
                    <router-link to="/lilv">利润预算</router-link>
                </el-menu-item>
                <el-menu-item index="4-2" v-if="permissions.indexOf('资金预算')>-1">
                    <router-link to="/zijin">资金预算</router-link>
                </el-menu-item>
                <el-menu-item index="4-3" v-if="permissions.indexOf('利润预算执行表')>-1">
                    <router-link to="/lizhi">利润预算执行表</router-link>
                </el-menu-item>
                <el-menu-item index="4-4" v-if="permissions.indexOf('资金预算执行表')>-1">
                    <router-link to="/zizhi">资金预算执行表</router-link>
                </el-menu-item>
            </el-submenu>
        </el-menu>
    </div>
    <router-view></router-view>
</div>
</template>
<script>
import {
    mapState,
    mapGetters
} from 'vuex'
export default {
    name: "budgetManage",
    data() {
        return {
        }
    },
    computed: {
        ...mapGetters({
            permissions: 'permissions'
        })  
    },
    methods:{
        handleOpen(key, keyPath){
            console.log(key, keyPath);
        },
        handleClose(key, keyPath) {
            console.log(key, keyPath);
        }
    },
}
</script>
<style scoped>
@import '../../common/css/index.css';

</style>
